home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / tsbat30.zip / c.bat < prev    next >
DOS Batch File  |  1991-09-27  |  643b  |  31 lines

  1. echo off
  2. echo Lazy changing of directory
  3. echo By Prof. Timo Salmi, ts@chyde.uwasa.fi, Fri 27-Sep-1991
  4. echo.
  5.  
  6. rem If you are fed up with typing \ in changing the directory
  7. rem this is the batch for you
  8.  
  9. rem E.g. if you have a directory \text\jokes\stupid the just use
  10. rem c text jokes stupid
  11. rem Applying c without parameters takes you to the root directory
  12.  
  13. set tmp_=
  14. :_loop
  15. set tmp_=%tmp_%\%1
  16. shift
  17. if not "%1"=="" goto _loop
  18.  
  19. if not "%tmp_%"=="\" if not exist %tmp_%\nul goto _error
  20.  
  21. echo Changing directory to %tmp_%
  22. cd %tmp_%
  23. goto _out
  24.  
  25. :_error
  26. echo Directory %tmp_% does not exist
  27.  
  28. :_out
  29. set tmp_=
  30. echo on
  31.